import React, { Component } from 'react';
import { HashRouter, Switch, Route } from 'react-router-dom';
//import createBrowserHistory from 'history/createBrowserHistory';

//import Layout1 from '../layouts/Layout1.js';
//import Layout2 from '../layouts/Layout2.js';

import Hello1 from '../views/Hello1.jsx';
import Hello2 from '../views/Hello2.jsx';
import Hello3 from '../views/Hello3.jsx';
import Hello4 from '../views/Hello4.jsx';
import Hello5 from '../views/Hello5.jsx';
//import Hello6 from '../views/Hello6.jsx';

const layoutRouter1 = [
    { path:"/Hello1", component: Hello1,},
    { path:"/Hello2", component: Hello2,},
];
const layoutRouter2 = [
    { path:"/Hello3", component: Hello3,},
    { path:"/Hello4", component: Hello4,},
];
const otherRouter = [
    { path:"/Hello5", component: Hello5,},
];

export default class RouteConfig extends Component{
    render(){
        return(
            <div>
                <HashRouter>
                    <Switch>
                        { layoutRouter1.map(item => <Route exact path={item.path}  component={item.component} key={item.path}/>) }
                        { layoutRouter2.map(item => <Route exact path={item.path}  component={item.component} key={item.path}/>) }
                        { otherRouter.map(item => <Route exact path={item.path}  component={item.component} key={item.path}/>) }
                    </Switch>
                </HashRouter>
            </div>
        )
    }
};